3.1086 \(\int \frac{1}{(a+i a \tan (e+f x)) (c+d \tan (e+f x))} \, dx\)

Optimal. Leaf size=128 \[ -\frac{d^2 \log (c \cos (e+f x)+d \sin (e+f x))}{a f (-d+i c) \left (c^2+d^2\right )}-\frac{c d x}{a (-d+i c) \left (c^2+d^2\right )}-\frac{1}{2 f (-d+i c) (a+i a \tan (e+f x))}+\frac{x}{2 a (c+i d)} \]

[Out]

x/(2*a*(c + I*d)) - (c*d*x)/(a*(I*c - d)*(c^2 + d^2)) - (d^2*Log[c*Cos[e + f*x] + d*Sin[e + f*x]])/(a*(I*c - d
)*(c^2 + d^2)*f) - 1/(2*(I*c - d)*f*(a + I*a*Tan[e + f*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.144501, antiderivative size = 128, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 28, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.179, Rules used = {3551, 3479, 8, 3484, 3530} \[ -\frac{d^2 \log (c \cos (e+f x)+d \sin (e+f x))}{a f (-d+i c) \left (c^2+d^2\right )}-\frac{c d x}{a (-d+i c) \left (c^2+d^2\right )}-\frac{1}{2 f (-d+i c) (a+i a \tan (e+f x))}+\frac{x}{2 a (c+i d)} \]

Antiderivative was successfully verified.

[In]

Int[1/((a + I*a*Tan[e + f*x])*(c + d*Tan[e + f*x])),x]

[Out]

x/(2*a*(c + I*d)) - (c*d*x)/(a*(I*c - d)*(c^2 + d^2)) - (d^2*Log[c*Cos[e + f*x] + d*Sin[e + f*x]])/(a*(I*c - d
)*(c^2 + d^2)*f) - 1/(2*(I*c - d)*f*(a + I*a*Tan[e + f*x]))

Rule 3551

Int[1/(((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])), x_Symbol] :> Dist[b/(
b*c - a*d), Int[1/(a + b*Tan[e + f*x]), x], x] - Dist[d/(b*c - a*d), Int[1/(c + d*Tan[e + f*x]), x], x] /; Fre
eQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0]

Rule 3479

Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(a*(a + b*Tan[c + d*x])^n)/(2*b*d*n), x] +
Dist[1/(2*a), Int[(a + b*Tan[c + d*x])^(n + 1), x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 + b^2, 0] && LtQ[n
, 0]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3484

Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> Simp[(a*x)/(a^2 + b^2), x] + Dist[b/(a^2 + b^2),
 Int[(b - a*Tan[c + d*x])/(a + b*Tan[c + d*x]), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 + b^2, 0]

Rule 3530

Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(c*Log[Re
moveContent[a*Cos[e + f*x] + b*Sin[e + f*x], x]])/(b*f), x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d,
0] && NeQ[a^2 + b^2, 0] && EqQ[a*c + b*d, 0]

Rubi steps

\begin{align*} \int \frac{1}{(a+i a \tan (e+f x)) (c+d \tan (e+f x))} \, dx &=\frac{\int \frac{1}{a+i a \tan (e+f x)} \, dx}{c+i d}-\frac{d \int \frac{1}{c+d \tan (e+f x)} \, dx}{a (i c-d)}\\ &=-\frac{c d x}{a (i c-d) \left (c^2+d^2\right )}-\frac{1}{2 (i c-d) f (a+i a \tan (e+f x))}+\frac{\int 1 \, dx}{2 a (c+i d)}-\frac{d^2 \int \frac{d-c \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{a (i c-d) \left (c^2+d^2\right )}\\ &=\frac{x}{2 a (c+i d)}-\frac{c d x}{a (i c-d) \left (c^2+d^2\right )}-\frac{d^2 \log (c \cos (e+f x)+d \sin (e+f x))}{a (i c-d) \left (c^2+d^2\right ) f}-\frac{1}{2 (i c-d) f (a+i a \tan (e+f x))}\\ \end{align*}

Mathematica [A]  time = 1.12042, size = 206, normalized size = 1.61 \[ \frac{-2 i c^2 f x+c^2+2 d^2 \log \left ((c \cos (e+f x)+d \sin (e+f x))^2\right )-4 d^2 (\tan (e+f x)-i) \tan ^{-1}\left (\frac{c \sin (f x)+d \cos (f x)}{d \sin (f x)-c \cos (f x)}\right )+\tan (e+f x) \left (2 i d^2 \log \left ((c \cos (e+f x)+d \sin (e+f x))^2\right )+(c+i d) (2 c f x-i c+2 i d f x-d)\right )+4 c d f x+2 i d^2 f x+d^2}{4 a f (c-i d) (c+i d)^2 (\tan (e+f x)-i)} \]

Antiderivative was successfully verified.

[In]

Integrate[1/((a + I*a*Tan[e + f*x])*(c + d*Tan[e + f*x])),x]

[Out]

(c^2 + d^2 - (2*I)*c^2*f*x + 4*c*d*f*x + (2*I)*d^2*f*x + 2*d^2*Log[(c*Cos[e + f*x] + d*Sin[e + f*x])^2] + ((c
+ I*d)*((-I)*c - d + 2*c*f*x + (2*I)*d*f*x) + (2*I)*d^2*Log[(c*Cos[e + f*x] + d*Sin[e + f*x])^2])*Tan[e + f*x]
 - 4*d^2*ArcTan[(d*Cos[f*x] + c*Sin[f*x])/(-(c*Cos[f*x]) + d*Sin[f*x])]*(-I + Tan[e + f*x]))/(4*a*(c - I*d)*(c
 + I*d)^2*f*(-I + Tan[e + f*x]))

________________________________________________________________________________________

Maple [A]  time = 0.052, size = 155, normalized size = 1.2 \begin{align*}{\frac{1}{af \left ( 2\,id+2\,c \right ) \left ( \tan \left ( fx+e \right ) -i \right ) }}-{\frac{{\frac{i}{4}}\ln \left ( \tan \left ( fx+e \right ) -i \right ) c}{af \left ( c+id \right ) ^{2}}}+{\frac{3\,\ln \left ( \tan \left ( fx+e \right ) -i \right ) d}{4\,af \left ( c+id \right ) ^{2}}}-{\frac{i\ln \left ( \tan \left ( fx+e \right ) +i \right ) }{af \left ( 4\,id-4\,c \right ) }}-{\frac{i{d}^{2}\ln \left ( c+d\tan \left ( fx+e \right ) \right ) }{af \left ( id-c \right ) \left ( c+id \right ) ^{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(a+I*a*tan(f*x+e))/(c+d*tan(f*x+e)),x)

[Out]

1/f/a/(2*I*d+2*c)/(tan(f*x+e)-I)-1/4*I/f/a/(c+I*d)^2*ln(tan(f*x+e)-I)*c+3/4/f/a/(c+I*d)^2*ln(tan(f*x+e)-I)*d-I
/f/a/(4*I*d-4*c)*ln(tan(f*x+e)+I)-I/f/a*d^2/(I*d-c)/(c+I*d)^2*ln(c+d*tan(f*x+e))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+I*a*tan(f*x+e))/(c+d*tan(f*x+e)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError

________________________________________________________________________________________

Fricas [A]  time = 1.63908, size = 306, normalized size = 2.39 \begin{align*} \frac{{\left ({\left (-2 i \, c^{2} + 4 \, c d - 6 i \, d^{2}\right )} f x e^{\left (2 i \, f x + 2 i \, e\right )} + 4 \, d^{2} e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (\frac{{\left (i \, c + d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + i \, c - d}{i \, c + d}\right ) + c^{2} + d^{2}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{{\left (-4 i \, a c^{3} + 4 \, a c^{2} d - 4 i \, a c d^{2} + 4 \, a d^{3}\right )} f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+I*a*tan(f*x+e))/(c+d*tan(f*x+e)),x, algorithm="fricas")

[Out]

((-2*I*c^2 + 4*c*d - 6*I*d^2)*f*x*e^(2*I*f*x + 2*I*e) + 4*d^2*e^(2*I*f*x + 2*I*e)*log(((I*c + d)*e^(2*I*f*x +
2*I*e) + I*c - d)/(I*c + d)) + c^2 + d^2)*e^(-2*I*f*x - 2*I*e)/((-4*I*a*c^3 + 4*a*c^2*d - 4*I*a*c*d^2 + 4*a*d^
3)*f)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+I*a*tan(f*x+e))/(c+d*tan(f*x+e)),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.40414, size = 243, normalized size = 1.9 \begin{align*} -\frac{-\frac{8 i \, d^{3} \log \left (-i \, d \tan \left (f x + e\right ) - i \, c\right )}{2 \, a c^{3} d + 2 i \, a c^{2} d^{2} + 2 \, a c d^{3} + 2 i \, a d^{4}} - \frac{{\left (-i \, c + 3 \, d\right )} \log \left (i \, \tan \left (f x + e\right ) + 1\right )}{a c^{2} + 2 i \, a c d - a d^{2}} - \frac{8 \, \log \left (\tan \left (f x + e\right ) + i\right )}{-8 i \, a c - 8 \, a d} - \frac{i \, c \tan \left (f x + e\right ) - 3 \, d \tan \left (f x + e\right ) + 3 \, c + 5 i \, d}{{\left (a c^{2} + 2 i \, a c d - a d^{2}\right )}{\left (\tan \left (f x + e\right ) - i\right )}}}{4 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+I*a*tan(f*x+e))/(c+d*tan(f*x+e)),x, algorithm="giac")

[Out]

-1/4*(-8*I*d^3*log(-I*d*tan(f*x + e) - I*c)/(2*a*c^3*d + 2*I*a*c^2*d^2 + 2*a*c*d^3 + 2*I*a*d^4) - (-I*c + 3*d)
*log(I*tan(f*x + e) + 1)/(a*c^2 + 2*I*a*c*d - a*d^2) - 8*log(tan(f*x + e) + I)/(-8*I*a*c - 8*a*d) - (I*c*tan(f
*x + e) - 3*d*tan(f*x + e) + 3*c + 5*I*d)/((a*c^2 + 2*I*a*c*d - a*d^2)*(tan(f*x + e) - I)))/f